Repository navigation
@remotion/media: Close decoded video frames when rendering throws - #13747
Open
alec-watts wants to merge 2 commits into
Open
alec-watts wants to merge 2 commits into
alec-watts wants to merge 2 commits into
Conversation
Contributor
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound — a try/finally around the borrowed frame guarantees close() on every exit path.
Reviewed changes: the full diff (2 files), plus the surrounding code in video-for-rendering.tsx.
finallyclose inVideoForRendering:imageBitmap.close()now runs infinally, covering throws fromonVideoFrame,drawImageandrunEffectChain. The early return after an incomplete effect chain is covered too, and the explicitclose()there is removed. Behavior is otherwise unchanged.- Regression test in
video.test.tsx: renders a still from the existing WebM fixture, throws fromonVideoFrame, and asserts the original error propagates andcloseis called once. It also swallows the duplicateunhandledrejectionthatcancelRenderproduces.
claude-sonnet-5-5 | 𝕏
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

A render-mode
<Video>borrows its decoded frame toonVideoFrame, draws it and optionally awaits effects. An exception in any of those steps could bypass the finalclose().Keep the frame alive through the last consumer and close it in
finally, including when an effect returns early. The existing render error continues to propagate.The browser regression renders a still from the existing WebM fixture, throws from the callback, and checks the original error and the close count on that specific frame. On the base commit, it observed zero closes. With this change, it observes one.